<#import "add_base.ftl" as add/>
<@add.html>
<script type="text/javascript">
  function getme(c) {
    if(c!="") {
      getJson("getPtBespeak?bespeakId="+c, function(data){
        if(data.ret) {
          var mc = data.data;
          var fm = getEl("fm_input");
          fm.bespeakId.value = mc.bespeakId;
          fm.contractCode.value = mc.contractCode;
          fm.shopCode.value = mc.shopCode+" - "+mc.shopName;
          fm.saleDate.value = getDateStr(new Date(mc.saleDate));
          fm.saleType.value = mc.saleType+" - "+mc.saleTypeName;
          fm.memberCode.value = mc.memberCode;
          fm.memberName.value = mc.memberName;
          fm.contractItem.value = mc.ptCode+" - "+mc.ptCodeName;
          fm.contractCoach.value = mc.coachCode+" - "+mc.coachName;
          fm.bespeakDate.value = mc.bespeakDate;
          fm.classTime.value = mc.classTime;
          fm.clearTime.value = mc.clearTime;
          fm.printLabel.value = mc.printLabel=="1"?"是":"否";
          fillData(mc);
        } else {
          window.alert(data.msg);
          clme();
        }
      });
    } else {
      clme();
    }
  }
  function clme() {
    var fm = getEl("fm_input");
    fm.contractCode.value = "";
    fm.shopCode.value = "";
    fm.saleDate.value = "";
    fm.saleType.value = "";
    fm.memberCode.value = "";
    fm.memberName.value = "";
    fm.contractItem.value = "";
    fm.contractCoach.value = "";
    fm.bespeakDate.value = "";
    fm.classTime.value = "";
    fm.clearTime.value = "";
    fm.printLabel.value = "";
    clearData();
  }
</script>
        <tr>
          <th width="85">预约号</th>
          <td width="160"><input type="text" name="bespeakId" value="" req="预约号" onchange="getme(this.value);" maxlength="20"></td>
          <th width="85"></th>
          <td width="160"></td>
        </tr>
        <tr>
          <th>私教合同号</th>
          <td><input type="text" name="contractCode" value="" class="disable" maxlength="20" readonly></td>
          <th>销售门店</th>
          <td><input type="text" name="shopCode" value="" class="disable" readonly></td>
        </tr>
        <tr>
          <th>销售日期</th>
          <td><input type="text" name="saleDate" value="" class="date disable" maxlength="10" readonly></td>
          <th>销售类别</th>
          <td><input type="text" name="saleType" value="" class="disable" readonly></td>
        </tr>
        <tr>
          <th>会员姓名</th>
          <td><input type="text" name="memberName" value="" maxlength="10" class="disable" readonly></td>
          <th>会员编号</th>
          <td><input type="text" name="memberCode" value="" class="disable" readonly></td>
        </tr>
        <tr>
          <th>课程</th>
          <td colspan="3"><input type="text" name="contractItem" value="" class="w2 disable" readonly></td>
        </tr>
        <tr>
          <th>教练</th>
          <td colspan="3"><input type="text" name="contractCoach" value="" class="w2 disable" readonly></td>
        </tr>
        <tr>
          <th>预约日期</th>
          <td><input type="text" name="bespeakDate" value="" class="disable" maxlength="10" readonly></td>
          <th>上课时间</th>
          <td><input type="text" name="classTime" value="" class="disable" maxlength="10" readonly></td>
        </tr>
        <tr>
          <th>是否打印</th>
          <td><input type="text" name="printLabel" value="" class="disable" maxlength="10" readonly></td>
          <th>核销时间</th>
          <td><input type="text" name="clearTime" value="" class="disable" maxlength="10" readonly></td>
        </tr>

</@add.html>